﻿@{
    ViewBag.Title = "About Us";
}

<h2>About</h2>
<p>
    <input id="messageToSend"/>
    <input id="sendButton" type="button" value="Send"/>
    <input id="moveButton" type="button" value="Move"/>
</p>

<ul id="messages">
        
</ul>


@section scripts{
    <script src="@Url.Content("~/Scripts/jquery.signalR.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/signalr/hubs")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            var snowBoardHub = $.connection.snowBoardHub;

            //$.connection.hub.start();

            $('#sendButton').click(function () {
                var val = $('#messageToSend').val();
                $('#messageToSend').val('');
                snowBoardHub.sendMessage('Crap', val);
            });

            $('#moveButton').click(function () {
                snowBoardHub.MoveSticker("stickId", 1, 2);
            });


            $.connection.hub.start();

            snowBoardHub.GetMessage = function (clientName, message) {
                $('#messages').append('<li>' + message + '</li>');
            };

        });
    </script>
}

